package com.devilvan.betrice.recruitment.configuration;

import com.devilvan.betrice.cache.CacheComponent;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Evad.Wu
 * @Description Boss直聘 header配置类
 * @date 2022-08-09
 */
@Lazy
@Configuration
public class BossJobHeaderConfig {
    @Resource(name = "cacheComponent")
    private CacheComponent cacheComponent;

    @Bean(value = "bossJobHeader")
    public Map<String, String> bossJobHeaderDto() {
        Map<String, String> header = new HashMap<>(16);
        header.put("accept", "application/json, text/plain, */*");
        header.put("accept-encoding", "gzip, deflate, br");
        header.put("accept-language", "zh-CN,zh;q=0.9");
        header.put("user-agent", cacheComponent.getRandomUserAgent());
        header.put("referer", "https://www.zhipin.com/web/geek/job");
        header.put(":authority", "www.zhipin.com");
        header.put(":method", "GET");
        header.put(":scheme", "https");

        header.put("token", "KPGOmDIMhhEWg1T9");
        header.put("zp_token", "V1RNojFeH73VxjVtRvyR0bLyqw6TLewi4~");
        header.put("cookie",
                "warlockjssdkcross=%7B%22distinct_id%22%3A%22180bcc1227da70-0a97f9d1e4c544-e726559-1821369-180bcc1227eb46%22%2C%22first_id%22%3A%22%22%2C%22props%22%3A%7B%7D%2C%22device_id%22%3A%22180bcc1227da70-0a97f9d1e4c544-e726559-1821369-180bcc1227eb46%22%7D; lastCity=101280600; wd_guid=39f31007-a9c1-44ae-b5e9-4f6ca909dad5; historyState=state; _bl_uid=hjl2y6d0dqXjthmCOytFx9Ft93th; _9755xjdesxxd_=32; YD00951578218230%3AWM_TID=%2FhkEUlFNgkdAQQQQABORTSlKk0tQhJa7; gdxidpyhxdE=E42jfNBDG%2FNUZpx8b9UiqzzBsuc7PG38bkDsqJeMqAiBfup5xJPQZ6rtGSKMzi%5CtekR%2BdTOJvUBQy7m4EkrkNBDLnhUHpjRBVB215moxMTHtTVj7lzNmDHsw1fipLSHhxWTl6cIyhmXtHQWwHBHgSStnN4POMSU8brvE%2BSDiJh7mJQa5%3A1659756107841; YD00951578218230%3AWM_NI=XD%2FCXiptSoeFNeKyxasX9J96xdVF7kF8SpKzhEU4PO9AUsS2d9c7uYbxYROk6gcHvIyw3Oec1D7IorwcZkuettRlf%2BoJDYOAN%2FlFd8g5SZUwo0dXKPgiapCmOIQ3H1r8Ylc%3D; YD00951578218230%3AWM_NIKE=9ca17ae2e6ffcda170e2e6ee8bfb54f492bb97bc6b98bc8ea6c85f928e9eacc8608ceb98b3ae398e8faf8af22af0fea7c3b92a9c9ce1a4db63b4ac9d90e84e8ebb859afb6bb188f7abbc3ebcbc9aa7b66186e89d91ca72ac9b9bd5d345fb9f9b94d23aa8e7add8f853a2a897b3ce61f6b9ada9f543bba9fdb0e869f39cf9aaee7ab5bd968cf86fb8ac9e8de521ad968cbace4b8ef1a4a7e734a5eb9dbbd87dadf0acb9ca5ca5b7af91c2678d979fd4cb3bb2e8978de237e2a3; wt2=D688DMNLREziAerLQm6WELmdo218duOnz4-6AuQHXU6HdINynCBA1oVTjPzr_c82lYjURis7EM5ARsTivwCag4A~~; wbg=0; acw_tc=0b328f3616600446516661111e010c0b9bea996b6ed46c86ecdbb552f19270; sid=sem_pz_bdpc_dasou_title; Hm_lvt_194df3105ad7148dcf2b98a91b5e727a=1659527177,1659681043,1659755184,1660044653; __zp_seo_uuid__=10aee28f-f93e-4b84-aef1-03394bff1ed1; __g=sem_pz_bdpc_dasou_title; Hm_lpvt_194df3105ad7148dcf2b98a91b5e727a=1660044676; __c=1660044654; __l=r=https%3A%2F%2Fwww.zhipin.com%2Fweb%2Fcommon%2Fsecurity-check.html%3Fseed%3DW5RLAUjFaqtgoYH61m5JCkaA8eqmg077WpS3TlqG7KA%253D%26name%3D75bf59c9%26ts%3D1660044652717%26callbackUrl%3Dhttps%253A%252F%252Fwww.zhipin.com%252Fshenzhen%252F%253Fsid%253Dsem_pz_bdpc_dasou_title&l=%2Fwww.zhipin.com%2Fweb%2Fgeek%2Fjob%3Fquery%3D%26city%3D101280600%26position%3D100101&s=3&friend_source=0&s=3&friend_source=0; __a=23684684.1652434216.1659755184.1660044654.47.6.6.6; __zp_stoken__=a7d5eZzwrdDdJaTxlaGFdTH4qJwNYIlpjPlYkWFJacUokKwVsZGonClBMQEJUaXBIHmQSCVwEK3Q2FiU8Lj90GAEpJUN5aXc5Sx0gcwxeexZqA1M5AXETdG12YHxIGyAGXF0gAC0OVAMJTT4%3D"
        );
        return header;
    }
}
